package org.sample.junit4.ex9;

import org.sample.junit4.Calculator;
import org.sample.junit4.Strings;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

@Configuration
public class AppConfig {
    @Bean
    public Calculator calculator() {
        return new Calculator();
    }

    @Bean
    public Strings strings() {
        return new Strings();
    }

    @Bean
    public StatefulCounter statefulCounter() {
        return new StatefulCounter();
    }

    @Bean
    public OffsetCalculatorService offsetCalculatorService() {
        return new OffsetCalculatorService();
    }

    // Profile: dev
    @Bean
    @Profile("dev")
    public NameProvider devNameProvider() {
        return new DevNameProvider();
    }

    // Profile: prod
    @Bean
    @Profile("prod")
    public NameProvider prodNameProvider() {
        return new ProdNameProvider();
    }
}
